<template>
	<view class="content">
		<view class="title">
			选择日期
		</view>
		<view class="games-content">
			<view @click="selectItem(index)" :class="selectStatus?'games ac':'games'" v-for="(item,index) in 5"
				:key="index">
				<text>08:00:00~08:59:59</text>
				<text>￥40</text>
			</view>
		</view>
	</view>
</template>

<script>
	import bus from '@/static/eventBus.js'
	export default {
		name: "gameCard",
		data() {
			return {
				selectStatus: true,
				selectDate: ''
			};
		},
		props: {
			ticketId: {
				type: Number,
				default: 1101
			}
		},
		methods: {
			selectItem(idx) {

			},
			getGames() {
				let that = this
				const member = uni.getStorageSync('member_id');
				const postData = {
					'ticket_id': that.ticketId,
					'date': that.selectDate,
					'sharer_id': member
				}
				console.log(postData);
				this.$u.post('/api/ticket_plan/games', postData).then(res => {
					
				}).catch(err => {
					
				})
			},
			getDate() {
				bus.$on('selectDate',(data) => {
					this.selectDate = data
				})
				console.log("传递的值", this.selectDate)
			}
		},
		created() {
			this.getGames()
			this.getDate()
		}
	}
</script>

<style lang="scss">


	
</style>
